route.ts 415 B

12345678910111213141516
  1. import { fetchRequestHandler } from "@trpc/server/adapters/fetch";
  2. import { appRouter } from "@/server/router";
  3. import { createContext } from "@/server/context";
  4. export const revalidate = 0;
  5. export const dynamic = "force-dynamic";
  6. const handler = (req: Request) =>
  7. fetchRequestHandler({
  8. endpoint: "/api",
  9. req,
  10. router: appRouter,
  11. createContext,
  12. });
  13. export { handler as GET, handler as POST };